package com.gzz.orchid.common.webmvc.support.limiter;

import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;

/**
 * @author higmd
 * 自定义条件注解 条件
 */
public class OnLimitAspectCondition implements Condition {
    @Override
    public boolean matches(ConditionContext context, AnnotatedTypeMetadata typeMetadata) {
        //检查配置文件是否包含limit.type属性
        return context
                .getEnvironment()
                .containsProperty(ConfigConstant.LIMIT_TYPE);
    }
}